<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>userList</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}"></link>
    <script type="text/javascript" th:src="@{/js/My97DatePicker/WdatePicker.js}"></script>
    <script type="text/javascript" src="/js/My97DatePicker/lang/zh-cn.js"></script>
    <script type="text/javascript" th:src="@{/js/jquery/jquery-1.10.2.min.js}"></script>
</head>
<body class="container">
<br/>
<h1>账单列表</h1>
<br/><br/>

<div class="with:80%">

    <form action="/bill/search" class="form-inline" id="qf" method="post">

        <div class="form-group">
            <label for="typeId" class="control-label">类型</label>
            <select name="typeId" id="typeId" class="form-control">
                <option value="-1" >全部</option>
                <option th:each="type : ${billTypes}" th:text="${type.name}" th:value="${type.id}" th:selected="${type.id}==${typeId}"></option>
            </select>
        </div>
        <div class="form-group">
            <label for="date1" class="control-label">开始时间</label>
            <input type="text" class="form-control" name="fromDate" id="date1" placeholder="开始时间" th:value="${fromDate}" onclick="WdatePicker()"/>
        </div>
        <div class="form-group">
            <label for="date2" class="control-label">结束时间</label>
            <input type="text" class="form-control" name="toDate"  id="date2" placeholder="结束时间" th:value="${toDate}" onclick="WdatePicker()"/>
        </div>
        <div class="form-group">
            <input type="submit" value="查询" class="btn btn-info" />
            &nbsp; &nbsp;
            <input type="reset" value="重置" class="btn btn-info" />
            &nbsp; &nbsp;
            <a href="/bill/toAdd" th:href="@{/bill/toAdd}" class="btn btn-info">添加</a>
        </div>
    </form>
</div>
<br/>


<div class="with:80%">
    <table class="table table-striped table-bordered">
        <thead>
            <tr>
                <th>序号</th>
                <th>标题</th>
                <th>时间</th>
                <th>金额</th>
                <th>类别</th>
                <th>说明</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr th:each="bill, status : ${bills}">
                <td th:text="${status.count}"></td>
                <td th:text="${bill.title}"></td>
                <td th:text="${#dates.format(bill.billTime, 'yyyy年MM月dd日')}"></td>
                <td th:text="${bill.price}"></td>
                <td th:text="${bill.billType.name}"></td>
                <td th:text="${bill.explain}"></td>
                <td><a th:href="@{/bill/toUpdate(billId = ${bill.id})}">更改</a></td>
            </tr>
        </tbody>
    </table>
</div>

</body>
</html>